/**
 * 单线条
 * ibio-develop
 * 2008-11-22 17:42
 */
package com.ibio8.components.wave.behavior {
	import com.ibio8.components.wave.WaveBody;
	
	import flash.utils.ByteArray;
	
	public class Line implements IWaveBehavior {
		
		public function show(ba:ByteArray, sp:WaveBody):void {
			
			sp.graphics.moveTo(0, sp.h / 2);
			
			for (var i:uint = 0; i < 256; i++) {
				var num:Number = -ba.readFloat() * (sp.w/2) + sp.h/2;
				sp.graphics.lineTo(i * sp.w / 256, num);
			}
		}
	}
}